import Vue from 'vue';
import VueRouter from 'vue-router';
import index from '../views/index.vue'
import login from '../views/account/login.vue';

Vue.use(VueRouter)

const routes = [
    // 主页ss
    {
        path: '/',
        name: 'index',
        component: index
    },
    // 登录
    {
        path: '/account/login',
        name: 'login',
        component: login
    },
    // 忘记密码
    {
        path: '/account/forgot',
        name: 'forgot',
        component: () => import('../views/account/forgot.vue')
    },
    // 注册账号
    {
        path: '/account/register',
        name: 'register',
        component: () => import('../views/account/register.vue')
    },
    // 媒体图片
    {
        path: '/media/image',
        name: 'media_image',
        component: () => import('../views/media/image.vue')
    },
    // 音乐
    {
        path: '/media/music',
        name: 'media_music',
        component: () => import('../views/media/music.vue')
    },
    // 媒体视频
    {
        path: '/media/video',
        name: 'media_video',
        component: () => import('../views/media/video.vue')
    },
    // 媒体视频
    {
        path: '/user_center/index',
        name: 'user_center_index',
        component: () => import('../views/user_center/index.vue')
    },
    // 文章路由
    {
        path: '/article/list',
        name: 'article_list',
        component: () => import('../views/article/list.vue')
    },
    {
        path: '/article/details',
        name: 'article_details',
        component: () => import('../views/article/details.vue')
    },
    // 浏览网站
    // 收藏路由
    {
        path: '/user/collect',
        name: 'collect_list',
        component: () => import('../views/user/collect.vue')
    },


    {
        path: '/comment/table',
        name: 'comment_table',
        component: () => import('../views/comment/table.vue')
    },
    {
        path: '/comment/view',
        name: 'comment_view',
        component: () => import('../views/comment/view.vue')
    },


    // 留言路由
    {
        path: '/message/list',
        name: 'message_list',
        component: () => import('../views/message/list.vue')
    },
    {
        path: '/message/edit',
        name: 'message_edit',
        component: () => import('../views/message/edit.vue')
    },
    // 留言板路由
    {
        path: '/message/table',
        name: 'message_table',
        component: () => import('../views/message/table.vue')
    },
    {
        path: '/message/view',
        name: 'message_view',
        component: () => import('../views/message/view.vue')
    },

    // 公告路由
    {
        path: '/notice/list',
        name: 'notice_list',
        component: () => import('../views/notice/list.vue')
    },
    {
        path: '/notice/details',
        name: 'notice_details',
        component: () => import('../views/notice/details.vue')
    },
    // 注册用户表格路由
    {
        path: '/registered_users/table',
        name: '/registered_users_table',
        component: () => import('../views/registered_users/table.vue')
    },
    // 注册用户详情路由
    {
        path: '/registered_users/view',
        name: '/registered_users_view',
        component: () => import('../views/registered_users/view.vue')
    },


    // 旅游路线表格路由
    {
        path: '/tourist_routes/table',
        name: '/tourist_routes_table',
        component: () => import('../views/tourist_routes/table.vue')
    },
    // 旅游路线详情路由
    {
        path: '/tourist_routes/view',
        name: '/tourist_routes_view',
        component: () => import('../views/tourist_routes/view.vue')
    },

    // 旅游路线列表路由
    {
        path: '/tourist_routes/list',
        name: '/tourist_routes_list',
        component: () => import('../views/tourist_routes/list.vue')
    },

    // 旅游路线详情路由
    {
        path: '/tourist_routes/details',
        name: '/tourist_routes_details',
        component: () => import('../views/tourist_routes/details.vue')
    },
    // 预订记录表格路由
    {
        path: '/booking_records/table',
        name: '/booking_records_table',
        component: () => import('../views/booking_records/table.vue')
    },
    // 预订记录详情路由
    {
        path: '/booking_records/view',
        name: '/booking_records_view',
        component: () => import('../views/booking_records/view.vue')
    },
    // 预订记录添加路由
    {
        path: '/booking_records/edit',
        name: '/booking_records_edit',
        component: () => import('../views/booking_records/edit.vue')
    },


    // 退订记录表格路由
    {
        path: '/unsubscribe_record/table',
        name: '/unsubscribe_record_table',
        component: () => import('../views/unsubscribe_record/table.vue')
    },
    // 退订记录详情路由
    {
        path: '/unsubscribe_record/view',
        name: '/unsubscribe_record_view',
        component: () => import('../views/unsubscribe_record/view.vue')
    },
    // 退订记录添加路由
    {
        path: '/unsubscribe_record/edit',
        name: '/unsubscribe_record_edit',
        component: () => import('../views/unsubscribe_record/edit.vue')
    },


    // 招聘信息表格路由
    {
        path: '/recruitment_information/table',
        name: '/recruitment_information_table',
        component: () => import('../views/recruitment_information/table.vue')
    },
    // 招聘信息详情路由
    {
        path: '/recruitment_information/view',
        name: '/recruitment_information_view',
        component: () => import('../views/recruitment_information/view.vue')
    },

    // 招聘信息列表路由
    {
        path: '/recruitment_information/list',
        name: '/recruitment_information_list',
        component: () => import('../views/recruitment_information/list.vue')
    },

    // 招聘信息详情路由
    {
        path: '/recruitment_information/details',
        name: '/recruitment_information_details',
        component: () => import('../views/recruitment_information/details.vue')
    },
    // 旅游分类表格路由
    {
        path: '/tourism_classification/table',
        name: '/tourism_classification_table',
        component: () => import('../views/tourism_classification/table.vue')
    },
    // 旅游分类详情路由
    {
        path: '/tourism_classification/view',
        name: '/tourism_classification_view',
        component: () => import('../views/tourism_classification/view.vue')
    },


    // 用户路由
    {
        path: '/user/index',
        name: 'user_index',
        component: () => import('../views/user/index.vue')
    },
    // 基本信息
    {
        path: '/user/info',
        name: 'user_info',
        component: () => import('../views/user/info.vue')
    },
    // 找回密码
    {
        path: '/user/password',
        name: 'user_password',
        component: () => import('../views/user/password.vue')
    },

    // 搜索
    {
        path: '/search',
        name: 'search',
        component: () => import('../views/search/index.vue')
    },
    // 局部搜索
    {
        path: '/search/details',
        name: 'search_details',
        component: () => import('../views/search/details.vue')
    }
]

const router = new VueRouter({
    mode: 'hash',
    base: process.env.BASE_URL,
    routes
})

router.afterEach((to, from, next) => {
    let title = "蓝海旅行社网站-home";
    document.title = title;
    document.logo = "蓝海旅行社网站"
})

export default router
